#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    string longestCommonPrefix(vector<string>& strs) {
        string ret;
        int i = 0;
        while (i < strs[0].size())
        {
            bool bp = false;
            char ch = strs[0][i];
            for (auto st : strs) if (i >= st.size() || ch != st[i]) bp = true;
            if (bp) break;
            i++;
            ret += ch;
        }
        return ret;
    }
};